<table class="class_list">
  <tr>
    <th><%= type.gsub('klass','class').capitalize %></th>
    <th>Failed</th>
    <th>In last 1 hour</th>
    <th>In last 3 hours</th>
    <th>In last 24 hours</th>
    <th>In last 3 days</th>
    <th>In last 7 days</th>
  </tr>
  <% @stats[type.to_sym].each do |field,count| %>
    <tr>
      <% filter = "#{q}=#{URI.encode(field)}" %>
      <td><%= field %></td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>"><%= count[:total] %></a>
      </td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>&f=1"><%= count[:h1] %></a>
      </td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>&f=3"><%= count[:h3] %></a>
      </td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>&f=24"><%= count[:d1] %></a>
      </td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>&f=72"><%= count[:d3] %></a>
      </td>
      <td class="number">
        <a href="cleaner_list?<%=filter%>&f=168"><%= count[:d7] %></a>
      </td>
    </tr>
  <% end %>
  <tr class="total">
    <td>Total</td>
    <td class="number"><a href="cleaner_list"><%= @total[:total] %></a></td>
    <td class="number"><a href="cleaner_list?f=1"><%= @total[:h1] %></a></td>
    <td class="number"><a href="cleaner_list?f=3"><%= @total[:h3] %></a></td>
    <td class="number"><a href="cleaner_list?f=24"><%= @total[:d1] %></a></td>
    <td class="number"><a href="cleaner_list?f=72"><%= @total[:d3] %></a></td>
    <td class="number"><a href="cleaner_list?f=168"><%= @total[:d7] %></a></td>
  </tr>
</table>
